//
//  HHMeController.m
//  oschina
//
//  Created by hjl on 16/3/30.
//  Copyright © 2016年 hjl. All rights reserved.
//

#import "HHMeController.h"
#import "HHDiscoverCell.h"
@interface HHMeController ()

@end

@implementation HHMeController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 注册cell
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([HHDiscoverCell class]) bundle:nil] forCellReuseIdentifier:@"HHDiscoverCell"];
    
    [self setupHeaderAndFooterView];
}


- (void)setupHeaderAndFooterView{
    // 头部栏
    UIView *headerView = [[UIView alloc]init];
    headerView.frame = CGRectMake(0, 0, HHWidth, 160);
    headerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"user-background"]];
    
    UIView *fengexian = [[UIView alloc]initWithFrame:CGRectMake(0, 110, HHWidth, 1)];
    fengexian.backgroundColor = HHRGBColor(222, 222, 222, 0.3);
    [headerView addSubview:fengexian];
    
    
    
    self.tableView.tableHeaderView = headerView;
    // 底部栏
    UIView *footerView = [[UIView alloc]init];
    self.tableView.tableFooterView = footerView;
}


#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 4;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    HHDiscoverCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HHDiscoverCell" forIndexPath:indexPath];
    if (indexPath.row == 0) {
        cell.nameLabel.text = @"消息";
        cell.iconImage.image = [UIImage imageNamed:@"me-message"];
    }else if (indexPath.row == 1){
        cell.nameLabel.text = @"博客";
        cell.iconImage.image = [UIImage imageNamed:@"me-blog"];
    }else if (indexPath.row == 2){
        cell.nameLabel.text = @"团队";
        cell.iconImage.image = [UIImage imageNamed:@"me-team"];
    }else if (indexPath.row == 3){
        cell.nameLabel.text = @"反馈";
        cell.iconImage.image = [UIImage imageNamed:@"me-feedback"];
    }
    
    return cell;
}

@end
